package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.YzStudentBirthday;
import com.ruoyi.system.mapper.YzStudentBirthdayMapper;
import com.ruoyi.system.service.IYzStudentBirthdayService;
import com.ruoyi.system.util.IdGenerate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 员工信息Service业务层处理
 *
 * @author linpq
 * @date 2020-04-10
 */
@Service
public class YzStudentBirthdayServiceImpl implements IYzStudentBirthdayService
{
    @Autowired
    private YzStudentBirthdayMapper yzStudentBirthdayMapper;

    /**
     * 查询员工信息
     *
     * @param id 员工信息ID
     * @return 员工信息
     */
    @Override
    public YzStudentBirthday selectYzStudentBirthdayById(String id)
    {
        return yzStudentBirthdayMapper.selectYzStudentBirthdayById(id);
    }

    /**
     * 查询员工信息列表
     *
     * @param yzStudentBirthday 员工信息
     * @return 员工信息
     */
    @Override
    public List<YzStudentBirthday> selectYzStudentBirthdayList(YzStudentBirthday yzStudentBirthday)
    {
        return yzStudentBirthdayMapper.selectYzStudentBirthdayList(yzStudentBirthday);
    }

    /**
     * 新增员工信息
     *
     * @param yzStudentBirthday 员工信息
     * @return 结果
     */
    @Override
    public int insertYzStudentBirthday(YzStudentBirthday yzStudentBirthday)
    {
        yzStudentBirthday.setCreateTime(DateUtils.getNowDate());
        yzStudentBirthday.setId(IdGenerate.uuid());
        return yzStudentBirthdayMapper.insertYzStudentBirthday(yzStudentBirthday);
    }

    /**
     * 修改员工信息
     *
     * @param yzStudentBirthday 员工信息
     * @return 结果
     */
    @Override
    public int updateYzStudentBirthday(YzStudentBirthday yzStudentBirthday)
    {
        yzStudentBirthday.setUpdateTime(DateUtils.getNowDate());
        return yzStudentBirthdayMapper.updateYzStudentBirthday(yzStudentBirthday);
    }

    /**
     * 删除员工信息对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYzStudentBirthdayByIds(String ids)
    {
        return yzStudentBirthdayMapper.deleteYzStudentBirthdayByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除员工信息信息
     *
     * @param id 员工信息ID
     * @return 结果
     */
    @Override
    public int deleteYzStudentBirthdayById(String id)
    {
        return yzStudentBirthdayMapper.deleteYzStudentBirthdayById(id);
    }


    /**
     * 用户状态修改
     *
     * @param
     * @return 结果
     */
    @Override
    public int changeStatus(YzStudentBirthday yzStudentBirthday)
    {
        return yzStudentBirthdayMapper.updateYzStudentBirthday(yzStudentBirthday);
    }
}
